package com.example.myretrofit2.service;

import com.example.myretrofit2.User;
import com.example.myretrofit2.httpResult.HttpResult;

import java.util.List;

import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

public interface UserService {
    @GET("user/test")
    Observable<HttpResult<List<User>>> getUser(@Query("id") String id);
    @POST("user/insert")
    Observable<HttpResult<Boolean>> insertUser(@Body User user);
    @POST("user/test")
    Observable<HttpResult<Boolean>> addUser(@Body User user);
    @GET("user/isLogin")
    Observable<HttpResult<Boolean>> isLogin();
    @POST("user/login")
    Observable<HttpResult<User>> login(@Body User user);
    @GET("user/updatePassword")
    Observable<HttpResult<Boolean>> updateUser(@Query("newPass") String newPass);
    @POST("user/cx")
    Observable<HttpResult<Boolean>> cx(@Body User user);

}
